<template>
  <div class="hello">
    vue i18n 国际化语言切换示例
    <p>{{$t('Home')}}</p>
    <p>{{$t('Calculated Properties')}}</p>
    <p>{{$t('formula')}}</p>
    <button @click="changeZHCNLanugage">切换中文语言</button>
    <button @click="changeENUSLanugage">切换英语语言</button>
  </div>
</template>

<script>

export default {
  name: 'HelloWorld',
  props: {
    msg: String
  },
  created(){
  },
  methods:{
    changeZHCNLanugage(){
      this.$i18n.locale = 'zh-CN';
    },
    changeENUSLanugage(){
      this.$i18n.locale = 'en-US';
    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
h3 {
  margin: 40px 0 0;
}
ul {
  list-style-type: none;
  padding: 0;
}
li {
  display: inline-block;
  margin: 0 10px;
}
a {
  color: #42b983;
}
</style>
